package com.ruoyi.cat.service.impl;

import java.util.List;

import com.ruoyi.cat.domain.CatChances;
import com.ruoyi.cat.mapper.CatChancesMapper;
import com.ruoyi.cat.service.ICatChancesService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 抽奖Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-26
 */
@Service
public class CatChancesServiceImpl implements ICatChancesService
{
    @Autowired
    private CatChancesMapper catChancesMapper;

    /**
     * 查询抽奖
     * 
     * @param id 抽奖主键
     * @return 抽奖
     */
    @Override
    public CatChances selectCatChancesById(Long id)
    {
        return catChancesMapper.selectCatChancesById(id);
    }

    /**
     * 查询抽奖列表
     * 
     * @param catChances 抽奖
     * @return 抽奖
     */
    @Override
    public List<CatChances> selectCatChancesList(CatChances catChances)
    {
        return catChancesMapper.selectCatChancesList(catChances);
    }

    /**
     * 新增抽奖
     * 
     * @param catChances 抽奖
     * @return 结果
     */
    @Override
    public int insertCatChances(CatChances catChances)
    {
        catChances.setCreateTime(DateUtils.getNowDate());
        return catChancesMapper.insertCatChances(catChances);
    }

    /**
     * 修改抽奖
     * 
     * @param catChances 抽奖
     * @return 结果
     */
    @Override
    public int updateCatChances(CatChances catChances)
    {
        return catChancesMapper.updateCatChances(catChances);
    }

    /**
     * 批量删除抽奖
     * 
     * @param ids 需要删除的抽奖主键
     * @return 结果
     */
    @Override
    public int deleteCatChancesByIds(Long[] ids)
    {
        return catChancesMapper.deleteCatChancesByIds(ids);
    }

    /**
     * 删除抽奖信息
     * 
     * @param id 抽奖主键
     * @return 结果
     */
    @Override
    public int deleteCatChancesById(Long id)
    {
        return catChancesMapper.deleteCatChancesById(id);
    }

    @Override
    public int updateCatChancesById(CatChances catChances) {
        return catChancesMapper.updateCatChancesById(catChances);
    }

    @Override
    public int deleteCatChancesByActivityId(Long activityId) {
        return catChancesMapper.deleteCatChancesByActivityId(activityId);
    }
}
